home *** CD-ROM | disk | FTP | other *** search
Text File | 1997-06-28 | 993 b | 41 lines | [TEXT/CWIE] |
- // SolidFrame.cp
-
- #ifndef SolidFrame_h
- #include "SolidFrame.h"
- #endif
- #ifndef ForegroundColorMaintainer_h
- #include "ForegroundColorMaintainer.h"
- #endif
- #ifndef ViewMap_h
- #include "ViewMap.h"
- #endif
-
- void SolidFrame::DrawBorder( const ViewMap& map, Rectangle interior ) const
- {
- ForegroundColorMaintainer cm( ForegroundColor() );
-
- Rectangle bounds( map.Bounds() );
- Rectangle top( bounds.left, bounds.top, bounds.right, interior.top );
- Rectangle bottom( bounds.left, interior.bottom, bounds.right, bounds.bottom );
- Rectangle left( bounds.left, interior.top, interior.left, interior.bottom );
- Rectangle right( interior.right, interior.top, bounds.right, interior.bottom );
-
- PaintRect( &top );
- PaintRect( &left );
- PaintRect( &right );
- PaintRect( &bottom );
- }
-
- void SolidFrame::ForegroundColorChanged()
- {
- ViewMap map( *this );
-
- if ( !map.Visible() )
- return;
-
- RegionObject region( map.Bounds() );
- region -= Interior().Bounds();
-
- ViewMap( *this ).Invalidate( region );
- }
-